5  Comparison of Four Methods

5.1 Data Preprocessing

DEG_deseq2 <- prep_deseq2(
    "../test_TransProR/Select DEGs/DEG_deseq2.Rdata"
)
head(DEG_deseq2, 5)
           logFC   Pvalue change    Gene
A1BG    2.549682 15.65356   down    A1BG
A2M     3.251168 15.65356     up     A2M
AADACL2 8.229956 15.65356   down AADACL2
ABCA12  6.392086 15.65356   down  ABCA12
ABCB5   5.644108 15.65356     up   ABCB5
DEG_edgeR <- prep_edgeR(
    "../test_TransProR/Select DEGs/DEG_edgeR.Rdata"
)
head(DEG_edgeR, 5)
                 logFC   Pvalue change          Gene
CH507-513H4.4 16.46830 15.65356   down CH507-513H4.4
CH507-513H4.3 16.18797 15.65356   down CH507-513H4.3
XBP1          15.00117 15.65356   down          XBP1
CH507-513H4.6 14.81025 15.65356   down CH507-513H4.6
KREMEN1       14.45332 15.65356   down       KREMEN1
limma <- prep_limma(
    "../test_TransProR/Select DEGs/DEG_limma_voom.Rdata"
)
head(limma, 5)
            logFC   Pvalue change    Gene
TOMM6   11.347906 15.65356   down   TOMM6
EEF1G   11.484561 15.65356   down   EEF1G
XBP1    12.063108 15.65356   down    XBP1
ARL6IP4  5.415435 15.65356   down ARL6IP4
CMC4     7.768105 15.65356   down    CMC4
Wilcoxon <- prep_wilcoxon(
    "../test_TransProR/Select DEGs/Wilcoxon_rank_sum_testoutRst.Rdata"
)
head(Wilcoxon, 5)
           logFC   Pvalue change    Gene
A1BG    2.512762 15.65356   down    A1BG
A2M     3.398259 15.65356     up     A2M
A2ML1   5.148162 15.65356   down   A2ML1
AADAC   3.018900 15.65356   down   AADAC
AADACL2 8.023014 15.65356   down AADACL2
deseq2_edgeR <-compare_merge(
  df1 = DEG_deseq2, 
  df2 = DEG_edgeR, 
  by_gene = "Gene", 
  compare_col = "change", 
  suffixes = c("_1", "_2"), 
  df_name = "deseq2_edgeR"
)
head(deseq2_edgeR, 5)
   logFC_1 Pvalue_1    Gene  logFC_2 Pvalue_2 change         name
1 3.251168 15.65356     A2M 3.405530 15.65356     up deseq2_edgeR
2 8.229956 15.65356 AADACL2 8.011049 15.65356   down deseq2_edgeR
3 6.392086 15.65356  ABCA12 5.946956 15.65356   down deseq2_edgeR
4 5.644108 15.65356   ABCB5 5.828844 15.65356     up deseq2_edgeR
5 3.797077 15.65356   ABCC3 3.638313 15.65356   down deseq2_edgeR
deseq2_limma <-compare_merge(
  df1 = DEG_deseq2, 
  df2 = limma, 
  by_gene = "Gene", 
  compare_col = "change", 
  suffixes = c("_1", "_2"), 
  df_name = "deseq2_limma"
)
head(deseq2_edgeR, 5)
   logFC_1 Pvalue_1    Gene  logFC_2 Pvalue_2 change         name
1 3.251168 15.65356     A2M 3.405530 15.65356     up deseq2_edgeR
2 8.229956 15.65356 AADACL2 8.011049 15.65356   down deseq2_edgeR
3 6.392086 15.65356  ABCA12 5.946956 15.65356   down deseq2_edgeR
4 5.644108 15.65356   ABCB5 5.828844 15.65356     up deseq2_edgeR
5 3.797077 15.65356   ABCC3 3.638313 15.65356   down deseq2_edgeR
deseq2_Wilcoxon <-compare_merge(
  df1 = DEG_deseq2, 
  df2 = Wilcoxon, 
  by_gene = "Gene", 
  compare_col = "change", 
  suffixes = c("_1", "_2"), 
  df_name = "deseq2_Wilcoxon"
)
head(deseq2_edgeR, 5)
   logFC_1 Pvalue_1    Gene  logFC_2 Pvalue_2 change         name
1 3.251168 15.65356     A2M 3.405530 15.65356     up deseq2_edgeR
2 8.229956 15.65356 AADACL2 8.011049 15.65356   down deseq2_edgeR
3 6.392086 15.65356  ABCA12 5.946956 15.65356   down deseq2_edgeR
4 5.644108 15.65356   ABCB5 5.828844 15.65356     up deseq2_edgeR
5 3.797077 15.65356   ABCC3 3.638313 15.65356   down deseq2_edgeR
edgeR_limma <-compare_merge(
  df1 = DEG_edgeR, 
  df2 = limma, 
  by_gene = "Gene", 
  compare_col = "change", 
  suffixes = c("_1", "_2"), 
  df_name = "edgeR_limma"
)
head(deseq2_edgeR, 5)
   logFC_1 Pvalue_1    Gene  logFC_2 Pvalue_2 change         name
1 3.251168 15.65356     A2M 3.405530 15.65356     up deseq2_edgeR
2 8.229956 15.65356 AADACL2 8.011049 15.65356   down deseq2_edgeR
3 6.392086 15.65356  ABCA12 5.946956 15.65356   down deseq2_edgeR
4 5.644108 15.65356   ABCB5 5.828844 15.65356     up deseq2_edgeR
5 3.797077 15.65356   ABCC3 3.638313 15.65356   down deseq2_edgeR
edgeR_Wilcoxon <-compare_merge(
  df1 = DEG_edgeR, 
  df2 = Wilcoxon, 
  by_gene = "Gene", 
  compare_col = "change", 
  suffixes = c("_1", "_2"), 
  df_name = "edgeR_Wilcoxon"
)
head(deseq2_edgeR, 5)
   logFC_1 Pvalue_1    Gene  logFC_2 Pvalue_2 change         name
1 3.251168 15.65356     A2M 3.405530 15.65356     up deseq2_edgeR
2 8.229956 15.65356 AADACL2 8.011049 15.65356   down deseq2_edgeR
3 6.392086 15.65356  ABCA12 5.946956 15.65356   down deseq2_edgeR
4 5.644108 15.65356   ABCB5 5.828844 15.65356     up deseq2_edgeR
5 3.797077 15.65356   ABCC3 3.638313 15.65356   down deseq2_edgeR
limma_Wilcoxon <-compare_merge(
  df1 = limma, 
  df2 = Wilcoxon, 
  by_gene = "Gene", 
  compare_col = "change", 
  suffixes = c("_1", "_2"), 
  df_name = "limma_Wilcoxon"
)
head(deseq2_edgeR, 5)
   logFC_1 Pvalue_1    Gene  logFC_2 Pvalue_2 change         name
1 3.251168 15.65356     A2M 3.405530 15.65356     up deseq2_edgeR
2 8.229956 15.65356 AADACL2 8.011049 15.65356   down deseq2_edgeR
3 6.392086 15.65356  ABCA12 5.946956 15.65356   down deseq2_edgeR
4 5.644108 15.65356   ABCB5 5.828844 15.65356     up deseq2_edgeR
5 3.797077 15.65356   ABCC3 3.638313 15.65356   down deseq2_edgeR
combined_df <- bind_rows(deseq2_edgeR, deseq2_limma, deseq2_Wilcoxon, edgeR_limma, edgeR_Wilcoxon, limma_Wilcoxon)
pal1 = c("#3949ab","#1e88e5","#039be5","#00897b","#43a047","#7cb342")
pal2 = c("#2787e0","#1a9ae0","#1dabbf","#00897b","#43a047","#7cb342")
pal3 = c("#00897b","#c0ca33")
pal4 = c("#1e88e5","#7cb342")

5.2 group_var = “name”

5.2.1 merge, show_points = FALSE

all_density_foldchange_name1 <- merge_density_foldchange(
  data = combined_df,
  x_var = "logFC_1",
  y_var = "logFC_2",
  group_var = "name",
  palette = pal1,
  show_points = FALSE,
  point_size = 2.5,
  point_alpha = 0.1,
  x_lim = c(0, 20),
  y_lim = c(0, 20),
  cor_method = "pearson",
  line_size = 1.6,
  cor_label_pos = c("left", "top")
)

all_density_foldchange_name1
`geom_smooth()` using formula = 'y ~ x'

5.2.2 merge, show_points = TRUE

all_density_foldchange_name2 <- merge_density_foldchange(
  data = combined_df,
  x_var = "logFC_1",
  y_var = "logFC_2",
  group_var = "name",
  palette = pal1,
  show_points = TRUE,
  point_size = 2.5,
  point_alpha = 0.2,
  x_lim = c(0, 20),
  y_lim = c(0, 20),
  cor_method = "pearson",
  line_size = 1.6,
  cor_label_pos = c("left", "top")
)

all_density_foldchange_name2
`geom_smooth()` using formula = 'y ~ x'

5.2.3 facet, show_points = FALSE, show_density = TRUE

all_facet_density_foldchange_name3 <- facet_density_foldchange(
  data = combined_df,
  x_var = "logFC_1",
  y_var = "logFC_2",
  group_var = "name",
  facet_var = "name",
  palette = pal2,
  show_points = FALSE,
  show_density = TRUE,
  point_size = 2.5,
  point_alpha = 0.1,
  line_size = 1.6,
  cor_method = "pearson",
  cor_label_pos = c("left", "top"),
  cor_vjust = 1
)

all_facet_density_foldchange_name3
`geom_smooth()` using formula = 'y ~ x'

5.2.4 facet, show_points = TRUE, show_density = FALSE

all_facet_density_foldchange_name4 <- facet_density_foldchange(
  data = combined_df,
  x_var = "logFC_1",
  y_var = "logFC_2",
  group_var = "name",
  facet_var = "name",
  palette = pal2,
  show_points = TRUE,
  show_density = FALSE,
  point_size = 2,
  point_alpha = 0.1,
  line_size = 1.6,
  cor_method = "pearson",
  cor_label_pos = c("left", "top"),
  cor_vjust = 1
)

all_facet_density_foldchange_name4
`geom_smooth()` using formula = 'y ~ x'

5.3 group_var = “change”

5.3.1 merge, show_points = FALSE

all_density_foldchange_name5 <- merge_density_foldchange(
  data = combined_df,
  x_var = "logFC_1",
  y_var = "logFC_2",
  group_var = "change",
  palette = pal3,
  show_points = FALSE,
  point_size = 2.5,
  point_alpha = 0.1,
  x_lim = c(0, 20),
  y_lim = c(0, 20),
  cor_method = "pearson",
  line_size = 1.6,
  cor_label_pos = c("left", "top")
)

all_density_foldchange_name5
`geom_smooth()` using formula = 'y ~ x'

5.3.2 merge, show_points = TRUE

all_density_foldchange_name6 <- merge_density_foldchange(
  data = combined_df,
  x_var = "logFC_1",
  y_var = "logFC_2",
  group_var = "change",
  palette = pal3,
  show_points = TRUE,
  point_size = 2.5,
  point_alpha = 0.2,
  x_lim = c(0, 20),
  y_lim = c(0, 20),
  cor_method = "pearson",
  line_size = 1.6,
  cor_label_pos = c("left", "top")
)

all_density_foldchange_name6
`geom_smooth()` using formula = 'y ~ x'

5.3.3 facet, show_points = FALSE, show_density = TRUE

all_facet_density_foldchange_name7 <- facet_density_foldchange(
  data = combined_df,
  x_var = "logFC_1",
  y_var = "logFC_2",
  group_var = "change",
  facet_var = "name",
  palette = pal3,
  show_points = FALSE,
  show_density = TRUE,
  point_size = 2.5,
  point_alpha = 0.1,
  line_size = 1.6,
  cor_method = "pearson",
  cor_label_pos = c("left", "top")
)

all_facet_density_foldchange_name7
`geom_smooth()` using formula = 'y ~ x'

5.3.4 facet, show_points = TRUE, show_density = FALSE

all_facet_density_foldchange_name8 <- facet_density_foldchange(
  data = combined_df,
  x_var = "logFC_1",
  y_var = "logFC_2",
  group_var = "change",
  facet_var = "name",
  palette = pal3,
  show_points = TRUE,
  show_density = FALSE,
  point_size = 2,
  point_alpha = 0.1,
  line_size = 1.6,
  cor_method = "pearson",
  cor_label_pos = c("left", "top")
)

all_facet_density_foldchange_name8
`geom_smooth()` using formula = 'y ~ x'